<div class="form">

	<?php
	$properties = array(
		'id'=>'document-form',
		'htmlOptions'=>array('enctype'=>'multipart/form-data'),
		'enableAjaxValidation'=>false
	);
	$form = $this->beginWidget('CActiveForm', $properties);
	?>

	<p class="note">
		Fields with <span class="required">*</span> are required.
	</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php
		$baseUrl = Yii::app()->request->baseUrl;
		$remove = CHtml::image(
		    "$baseUrl/images/toolbars/cross-script.png", 'Remove'
		);
		echo $form->labelEx($model, 'images');
		$properties = array(
			'model'=>$model,
			'attribute'=>'images',
			'max'=>100,
			'accept'=>'jpg|jpeg|gif|png|tif',
			'remove'=>$remove,
		);
		$this->widget('CMultiFileUpload', $properties);
		echo $form->error($model, 'images');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'code');
		echo $form->textField(
			$model, 'code', array('size'=>60, 'maxlength'=>255)
		);
		echo $form->error($model, 'code');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'synopsis');
		$htmlOptions = array('rows'=>6, 'cols'=>50, 'class'=>'monospace');
		echo $form->textArea($model, 'synopsis', $htmlOptions);
		echo $form->error($model, 'synopsis');
		?>
	</div>

	<div class="row buttons">
		<?php
		echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
		?>
	</div>

	<?php $this->endWidget(); ?>

</div><!-- form -->